package com.define.ssh.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Deptuser entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "deptaccount")
public class DeptAccount implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private UserInfo userInfo;
	private Compdept compdept;

	private Integer deptid;
	private Integer userid;

	// Constructors

	/** default constructor */
	public DeptAccount() {
	}

	// Property accessors

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "userid", unique = false, nullable = true, insertable = false, updatable = false)
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "deptid", unique = false, nullable = true, insertable = false, updatable = false)
	public Compdept getCompdept() {
		return compdept;
	}

	public void setCompdept(Compdept compdept) {
		this.compdept = compdept;
	}

	@Id
	@Column(name = "deptid", unique = true, nullable = false)
	public Integer getDeptid() {
		return deptid;
	}

	public void setDeptid(Integer deptid) {
		this.deptid = deptid;
	}

	@Id
	@Column(name = "userid", unique = true, nullable = false)
	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

}
